package com.hdu.clj.dncard.database

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
import android.widget.Toast


class UserDatabase(val context: Context, name:String, version:Int): SQLiteOpenHelper(context,name,null,version) {

    /**
     * id 主键
     * acc 账号 （数字+字母）
     * pass 密码 (数字+字母)
     * isCreate 是否创建角色
     */

    private val dayNumBook = "create table Users (" +
            "id integer primary key autoincrement," +
            "acc text," +
            "pass text," +
            "name text," +
            "exp integer,"+
            "isCreate integer)"

    override fun onCreate(db: SQLiteDatabase) {
        db.execSQL(dayNumBook)
    }

    override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {

    }
}